.class Lcom/nemustech/regina/ElementAndroidWidget$2;
.super Ljava/lang/Object;
.source "ElementAndroidWidget.java"

# interfaces
.implements Ljava/lang/Runnable;


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/nemustech/regina/ElementAndroidWidget;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation


# instance fields
.field final synthetic this$0:Lcom/nemustech/regina/ElementAndroidWidget;


# direct methods
.method constructor <init>(Lcom/nemustech/regina/ElementAndroidWidget;)V
    .locals 0
    .parameter

    .prologue
    .line 169
    iput-object p1, p0, Lcom/nemustech/regina/ElementAndroidWidget$2;->this$0:Lcom/nemustech/regina/ElementAndroidWidget;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public run()V
    .locals 6

    .prologue
    .line 171
    iget-object v1, p0, Lcom/nemustech/regina/ElementAndroidWidget$2;->this$0:Lcom/nemustech/regina/ElementAndroidWidget;

    iget-object v1, v1, Lcom/nemustech/regina/ElementAndroidWidget;->mHostView:Lcom/nemustech/regina/ReginaAppWidgetHostView;

    if-eqz v1, :cond_1

    .line 172
    iget-object v1, p0, Lcom/nemustech/regina/ElementAndroidWidget$2;->this$0:Lcom/nemustech/regina/ElementAndroidWidget;

    iget-object v1, v1, Lcom/nemustech/regina/ElementAndroidWidget;->mHostView:Lcom/nemustech/regina/ReginaAppWidgetHostView;

    invoke-virtual {v1}, Lcom/nemustech/regina/ReginaAppWidgetHostView;->getDrawingCache()Landroid/graphics/Bitmap;

    move-result-object v0

    .line 173
    .local v0, cachedBitmap:Landroid/graphics/Bitmap;
    if-eqz v0, :cond_2

    .line 174
    const-class v1, Lcom/nemustech/tiffany/world/TFWorld;

    monitor-enter v1

    .line 175
    :try_start_0
    iget-object v2, p0, Lcom/nemustech/regina/ElementAndroidWidget$2;->this$0:Lcom/nemustech/regina/ElementAndroidWidget;

    iget-object v2, v2, Lcom/nemustech/regina/ElementAndroidWidget;->mBitmap:Landroid/graphics/Bitmap;

    if-eqz v2, :cond_0

    iget-object v2, p0, Lcom/nemustech/regina/ElementAndroidWidget$2;->this$0:Lcom/nemustech/regina/ElementAndroidWidget;

    iget-object v2, v2, Lcom/nemustech/regina/ElementAndroidWidget;->mBitmap:Landroid/graphics/Bitmap;

    invoke-virtual {v2}, Landroid/graphics/Bitmap;->recycle()V

    .line 176
    :cond_0
    iget-object v2, p0, Lcom/nemustech/regina/ElementAndroidWidget$2;->this$0:Lcom/nemustech/regina/ElementAndroidWidget;

    invoke-static {v0}, Landroid/graphics/Bitmap;->createBitmap(Landroid/graphics/Bitmap;)Landroid/graphics/Bitmap;

    move-result-object v3

    iput-object v3, v2, Lcom/nemustech/regina/ElementAndroidWidget;->mBitmap:Landroid/graphics/Bitmap;

    .line 177
    iget-object v2, p0, Lcom/nemustech/regina/ElementAndroidWidget$2;->this$0:Lcom/nemustech/regina/ElementAndroidWidget;

    iget-object v2, v2, Lcom/nemustech/regina/ElementAndroidWidget;->mPanel:Lcom/nemustech/tiffany/world/TFCustomPanel;

    const/4 v3, 0x0

    const/4 v4, 0x0

    const/4 v5, 0x0

    invoke-virtual {v2, v3, v4, v5}, Lcom/nemustech/tiffany/world/TFCustomPanel;->setImageResource(ILandroid/graphics/Bitmap;Landroid/graphics/Rect;)Z

    .line 178
    iget-object v2, p0, Lcom/nemustech/regina/ElementAndroidWidget$2;->this$0:Lcom/nemustech/regina/ElementAndroidWidget;

    iget-object v2, v2, Lcom/nemustech/regina/ElementAndroidWidget;->mHostView:Lcom/nemustech/regina/ReginaAppWidgetHostView;

    const/4 v3, 0x0

    invoke-virtual {v2, v3}, Lcom/nemustech/regina/ReginaAppWidgetHostView;->setUpdated(Z)V

    .line 179
    iget-object v2, p0, Lcom/nemustech/regina/ElementAndroidWidget$2;->this$0:Lcom/nemustech/regina/ElementAndroidWidget;

    iget-object v2, v2, Lcom/nemustech/regina/ElementAndroidWidget;->mWorkspace:Lcom/nemustech/regina/RGWorkspace;

    const/high16 v3, 0x3f00

    invoke-virtual {v2, v3}, Lcom/nemustech/regina/RGWorkspace;->updateThumb(F)V

    .line 180
    monitor-exit v1

    .line 186
    .end local v0           #cachedBitmap:Landroid/graphics/Bitmap;
    :cond_1
    :goto_0
    return-void

    .line 180
    .restart local v0       #cachedBitmap:Landroid/graphics/Bitmap;
    :catchall_0
    move-exception v2

    monitor-exit v1
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v2

    .line 183
    :cond_2
    const-string v1, "CachedBitmapGetter"

    const-string v2, "Couldn\'t get cached bitmap from widget host view"

    invoke-static {v1, v2}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

    goto :goto_0
.end method
